﻿using System;
using System.Collections.Generic;
using Newtonsoft.Json;

namespace Wala.Connection.Objects.Timeline
{
    public class TagData
    {
        #region //-------- Private Fields --------//

        private List<UserInfo> _lstUserInfo;

        #endregion

        #region //-------- CLR Properties ----------//

        public List<UserInfo> LstUserInfo
        {
            get { return _lstUserInfo; }
            set { _lstUserInfo = value; }
        }

        #endregion

        #region //------- Public Constructor --------//

        public TagData()
        {
        }

        #endregion

        #region //--------- Public Methods ----------//

        public static TagData FromJson(string json)
        {
            try
            {
                TagData tagData = new TagData();
                RetUserInfo userInfo = JsonConvert.DeserializeObject<RetUserInfo>(json);
                tagData.LstUserInfo = userInfo.user_info;
                return tagData;
            }
            catch (Exception ex)
            {
                return new TagData();
            }
        }

        #endregion
    }
}
